//
//  GoodsDetailIntroduceTableViewCell.m
//  much
//
//  Created by weijunjie on 2019/1/7.
//  Copyright © 2019年 iOS. All rights reserved.
//

#import "GoodsDetailIntroduceTableViewCell.h"

static NSString *GoodsDetailIntroduceTableViewCellIdentifier = @"GoodsDetailIntroduceTableViewCellIdentifier";
@interface GoodsDetailIntroduceTableViewCell ()
@property (nonatomic, strong) UIView *topLineView; // 顶部线条
@property (nonatomic, strong) UIImageView *contentImageView; // 内容

@end
@implementation GoodsDetailIntroduceTableViewCell

+ (instancetype)detailIntroduceTableViewCellWithTableView:(UITableView *)tableView {
    GoodsDetailIntroduceTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:GoodsDetailIntroduceTableViewCellIdentifier];
    if (!cell) {
        cell = [[GoodsDetailIntroduceTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:GoodsDetailIntroduceTableViewCellIdentifier];
    }
    return cell;
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        self.backgroundColor = [UIColor whiteColor];
        self.contentImageView.image = [UIImage imageNamed:@"store_detal_ad"];
    }
    return self;
}

#pragma mark - 懒加载
- (UIView *)topLineView {
    if (!_topLineView) {
        _topLineView = [[UIView alloc] init];
        _topLineView.backgroundColor = Color244;
        [self.contentView addSubview:_topLineView];
        [_topLineView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.top.right.equalTo(self.contentView);
            make.height.mas_equalTo(10);
        }];
    }
    return _topLineView;
}

- (UIImageView *)contentImageView {
    if (!_contentImageView) {
        _contentImageView = [[UIImageView alloc] init];
        [self.contentView addSubview:_contentImageView];
        [_contentImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.topLineView.mas_bottom).offset(20);
            make.left.equalTo(self.contentView).offset(15);
            make.right.equalTo(self.contentView).offset(-15);
            make.bottom.equalTo(self.contentView).offset(-10);
        }];
    }
    return _contentImageView;
}



@end
